﻿@using Pay.Token.Utils
@model PagedResult<product_shop_dto>
@{
    var img_url = ViewBag.img_url;
    var user_type = ViewBag.UserType;
    var shop_id = ViewBag.shop_id;
    var share_no = ViewBag.share_no;
    if (Model.rows.Count > 0) {
        foreach (var item in Model.rows) {
            <li class="item">
                <a href="/DistributionMall/ProductDetail?productId=@item.id&merchant_no=@share_no&shopId=@shop_id" target="_blank">
                    <div class="itemBox">
                        <div class="img">
                            <img src="@(item.main_image_url)" />
                        </div>
                        <div class="box">
                            <p class="tit">@item.name</p>
                            <div class="mb20">
                                <p>
                                    @if (item.price > 0) {
                                        <em class="col-red fn20">￥</em>
                                        <span class="col-red fn32">@item.price.ToString("0.##")</span>
                                    }

                                    @if (item.activity_ex != null && item.price > 0 && item.activity_ex.activity_red_drill > 0) {
                                        <span class="col-red">+</span>
                                    }

                                    @if (item.activity_ex != null && item.activity_ex.activity_red_drill > 0) {
                                        <span class="col-red fn32">@item.activity_ex.activity_red_drill.ToString("0.######")</span> <em class="col-red fn20">红钻</em>
                                    }
                                </p>
                                @if(item.activity_ex == null || item.activity_ex.activity_type != EActivityType.ProductMaker){
                                <p style="white-space:nowrap;">
                                    <em class="col-red fn20">佣金</em>
                                    @{decimal price = DistributionHelper.GetProfitByLevel(item.distribution_price, user_type);
                                    }
                                    <span class="col-red fn28 fontweight">@price.ToString("f2")</span>
                                </p>
                                }
                            </div>
                            @*<span class="ui-btn-share ui-btn-share-100 fxPro" href="javascript:void(0)" data-main_image_url="@(item.main_image_url)" data-price="@item.price" data-cost-price="@item.market_price" data-name="@(item.name.Length>30?item.name.Substring(0,30):item.name)" data-id="@item.id">立即分享</span>*@
                        </div>
                    </div>
                </a>
            </li>

        }
    }
    <page total_pages="@Model.total_pages" rows="@Model.rows.Count()" total_result="@Model.total_result"></page>
}
@*<script type="text/javascript">
        $(function () {
            // 瀑布流
            $('.wall').jaliswall({ item: '.item' });
        })
    </script>*@

